using System;
using System.Windows.Forms;
using System.Collections;
using Curriculum.Business.Manejadores;
using Curriculum.UI.Utiles;

namespace Curriculum.UI.Clases.ManejadorControles
{
	/// <summary>
	/// Summary description for ManejadorComboMeses.
	/// </summary>
	public class ManejadorComboMeses : ManejadorControles
	{
		public ManejadorComboMeses()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		public override void Cargar(System.Windows.Forms.Control ctrl, object value)
		{
			if(value != null)
				((ComboBox)ctrl).SelectedItem = (string) value;
		}
		public override void Inicializar(Control ctrl, object value)
		{
			ComboBox combo = ((ComboBox)ctrl);			
			combo.DropDownStyle = ComboBoxStyle.DropDownList;

			foreach (string mes in ListasUtils.GetListaMeses())
			{
				combo.Items.Add(mes);
			}
		}
		public override string GetValor(Control ctrl)
		{
			string valorSeleccionado = string.Empty;
			if (((ComboBox)ctrl).SelectedItem != null)
			{
				valorSeleccionado = ((ComboBox)ctrl).SelectedItem.ToString();
			}
			return valorSeleccionado;
		}
	}
}
